#include <iostream>
#include <sys/time.h>
#include <fstream>
#include <chrono>
#include <ctime>
#include <vector>
using namespace std;
using std::chrono::milliseconds;
vector<int> skz(vector<int> a, string filename){
        bool SKZ = true;                        
    int Z = a.size();
    while(SKZ){                                 
        SKZ = false;                            
        for(int i = 0 ; i<Z-1;i++){
            if(a[i]>a[i+1]){
                swap(a[i],a[i+1]);
                SKZ = true;                     
            }
        }
         Z--;
    }
    cout << endl;  
    return a;
}
vector<int> zks(string filename){              
    vector<int> a;
    ifstream file;
    file.open(filename);
    string y;
    while(file.good()){
        getline(file,y);
        a.push_back(stoi(y));
    }
return a;    
}
int main()
{
   namespace sc = chrono;
   vector<int> a;
   vector<string> filenames = {"m1_sorted.txt","m2_reverse.txt","m3_shuffle.txt"};
   for(int i = 0; i<3; i++){
        time_t start = time(nullptr);
        time_t end = time(nullptr);
        a = skz(zks(filenames[i]),filenames[i]);                       
        cout <<filenames[i]<<" = "<< start-end <<" "<<"millisekonds" << endl;
    }
}